import pandas as pd

# 文件路径
merged_file_path = r'C:\Users\Administrator\Downloads\1610\merged_output.csv'
initial_list_path = r'C:\Users\Administrator\Downloads\147-1\initialList.csv'

# 读取合并后的CSV文件
merged_df = pd.read_csv(merged_file_path)

# 读取包含要删除的地址的CSV文件
initial_list_df = pd.read_csv(initial_list_path)

# 获取要删除的地址列表
addresses_to_remove = initial_list_df['ADDRESS'].tolist()

# 删除匹配的行
filtered_df = merged_df[~merged_df['user_address'].isin(addresses_to_remove)]

# 保存过滤后的结果到一个新的CSV文件
filtered_file_path = r'C:\Users\Administrator\Downloads\1610\filtered_output.csv'
filtered_df.to_csv(filtered_file_path, index=False)

print('处理完成，结果已保存为 filtered_output.csv')
